package com.kathony.jangpa.b.config;

import java.util.Hashtable;

public class LDConfig {
	protected Hashtable<String,String> _config = new Hashtable<String,String>();
	
	public void setParams(String key, String value){
		this._config.put(key, value);
	}
	
	public String getParams(String key){
		return this._config.get(key);
	}
	
	public boolean hasKey(String key){
		return this._config.containsKey(key);
	}
	
	public boolean hasIntKey(String key){
		if ( this._config.containsKey(key) ){
			try {
				Integer.parseInt(this._config.get(key));
				return true;
			}
			catch(NumberFormatException e){
			}
		}
		return false;
	}
	
	public int getInt(String key){
		int out=0;
		try {
			out=Integer.parseInt(this._config.get(key));
			
		}
		catch(NumberFormatException e){
		}
		
		return out;
	}
	
}
